package com.cloud.wms.http;

import android.os.Bundle;

import com.cloud.wms.app.FineExApplication;
import com.cloud.wms.ui.main.entity.MemberEntity;

import java.util.HashMap;

/**
 * Created by Tanghaibo
 * 2018/3/22
 * description: 请求体基类
 */

public class Params extends HashMap<String, Object> {
    public Params() {
    }


    public static Params newInstance(Type type) {
        Params params = new Params();
        switch (type) {
            case MEMBER:
                params.put("WarehouseID", FineExApplication.component().loginCache().getWarehouseInfo().getWarehouseID());
                params.put("MemberID", FineExApplication.component().loginCache().getMemberID());
                break;
            case WAREHOUSE:
                params.put("WarehouseID", FineExApplication.component().loginCache().getWarehouseInfo().getWarehouseID());
                break;
            case SUBMIT:
                params.put("WarehouseID", FineExApplication.component().loginCache().getWarehouseInfo().getWarehouseID());
                params.put("MemberID", FineExApplication.component().loginCache().getMemberID());
                params.put("AppKey", FineExApplication.component().loginCache().getAppKey());
                break;
            case TASK:
                params.put("WarehouseID", FineExApplication.component().loginCache().getWarehouseInfo().getWarehouseID());
                params.put("MemberID", FineExApplication.component().loginCache().getMemberID());
                params.put("companyID", FineExApplication.component().loginCache().getUserInfo().getCompanyID());
                params.put("jobStationID", FineExApplication.component().loginCache().getUserInfo().getJobStationID());
                params.put("productCategory", FineExApplication.component().loginCache().getUserInfo().getProductCategory());
                params.put("departmentID", FineExApplication.component().loginCache().getUserInfo().getDepartmentID());
                break;
        }
        return params;
    }

    public enum Type {
        WAREHOUSE,
        MEMBER,
        SUBMIT,
        TASK
    }
}
